<template>
  <div class="container">
    <div class="sbgl-nav breadcrumb">
      <img src="static/img/shu.png" alt="">
      <span>系统设置</span>
      <span class="glyphicon glyphicon-chevron-right"></span>
      <span>转发服务器</span>
    </div>
    <form class="form-horizontal" @submit.prevent="submit">
      <div class="form-group">
          <label for="inputnumber" class="col-sm-2 control-label col-sm-offset-3">转发服务器IP：</label>
          <div class="col-sm-4">
            <input type="text" class="form-control" id="inputnumber" placeholder="10.10.1.212" name="ip" value="" v-model="hdrModel.ip">
          </div>
      </div>
      <div class="form-group">
          <label for="inputnumber1" class="col-sm-2 control-label col-sm-offset-3">RTSP端口：</label>
          <div class="col-sm-4">
            <input type="number" class="form-control" id="inputnuber1" placeholder="552" name="rtspport" value="" v-model="hdrModel.rtspport">
          </div>
      </div>
      <div class="form-group">
          <label for="inputnumber2" class="col-sm-2 control-label col-sm-offset-3">HTTP端口：</label>
          <div class="col-sm-4">
            <input type="number" class="form-control" id="inputnumber2" placeholder="9905" name="httpport" value="" v-model="hdrModel.httpport">
          </div>
      </div>
      <p class="lx_btn">
        <button type="submit" class="btn btn-default btn-lg">保存</button>
        <button type="button" onclick="window.history.go(-1)" class="btn btn-default btn-lg">返回</button>
      </p>
    </form>
  </div>
</template>

<script>
  export default {
    name: 'HDRServer',
    data: function () {
      return {
        hdrModel: {}
      }
    },
    created: function () {
      this.$http.post('/api/hedacmdreq', {method: 'GetHDRConf'}).then(response => {
        this.hdrModel = response.data.HedaACK.Body
      })
    },
    methods: {
      submit: function () {
        this.hdrModel['method'] = 'HDRConf'
        this.$http.post('/api/hedacmdreq', this.hdrModel).then(response => {
          var body = response.data.HedaACK.Body
          window.duang.msg(true, body.retMsg)
        })
      }
    }
  }
</script>
